/*
 * Copyright (c) 2013-2015 Charkey. All rights reserved.
 *
 * This software is the confidential and proprietary information of Charkey.
 * You shall not disclose such Confidential Information and shall use it only
 * in accordance with the terms of the agreements you entered into with Charkey.
 *
 * Charkey MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
 *
 * Charkey SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
 * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
 */

package cn.simastudio.talos.core.service.base.impl;

import cn.simastudio.talos.core.model.base.Client;
import cn.simastudio.talos.core.service.base.ClientService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClientServiceImpl implements ClientService {

    @Override
    public Client createClient(Client client) {
        return null;
    }

    @Override
    public Client updateClient(Client client) {
        return null;
    }

    @Override
    public void deleteClient(Long clientId) {
    }

    @Override
    public Client findOne(Long clientId) {
        return null;
    }

    @Override
    public List<Client> findAll() {
        return null;
    }

    @Override
    public Client findByClientId(String clientId) {
        if (clientId.equals("c1ebe466-1cdc-4bd3-ab69-77c3561b9dee")) {
            Client client = new Client();
            client.setClientId("c1ebe466-1cdc-4bd3-ab69-77c3561b9dee");
            client.setClientName("chapter17-client");
            client.setClientSecret("d8346ea2-6017-43ed-ad68-19c0f971738b");
            return client;
        } else {
            return null;
        }
    }

    @Override
    public Client findByClientSecret(String clientSecret) {
        if (clientSecret.equals("d8346ea2-6017-43ed-ad68-19c0f971738b")) {
            Client client = new Client();
            client.setClientId("c1ebe466-1cdc-4bd3-ab69-77c3561b9dee");
            client.setClientName("chapter17-client");
            client.setClientSecret("d8346ea2-6017-43ed-ad68-19c0f971738b");
            return client;
        } else {
            return null;
        }
    }
}
